# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 12:08:25 2020

@author: Monstare
"""

import geopandas as gpd
import pandas as pd
from shapely.geometry import Polygon

testpoint=[(118.647,32.093), (118.712,32.093), (118.712,32.138),(118.647,32.138),(118.647,32.093)]


def getpolygon(polygonpoint):
    poly=pd.DataFrame()
    poly['geometry']=[Polygon(polygonpoint)]
    shapedata = gpd.GeoDataFrame(poly)
    shapedata.crs={'init':'epsg:4326'}
    shapedata.to_file("..\\data\\result\\studyregion.shp",encoding = "utf-8")
    return "studyregion.shp"


regionname=getpolygon(testpoint)
    